#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""

@Time   :2025/7/29 上午11:35
@Author :zengjiahao1989@gmail.com
@File   :module.py
"""
from flask_migrate import Migrate
# from flask_sqlalchemy import SQLAlchemy
from injector import Module, Binder

from internal.extension.database_extension import db
from internal.extension.migrate_extenion import migrate
from pkg.sqlalchemy import SQLAlchemy


class ExtensionModule(Module):
    # 因为已经实例化，所以以这种方式绑定
    # 普通的依赖注入只需要inject修饰符
    def configure(self, binder: Binder) -> None:
        binder.bind(SQLAlchemy, to=db)
        binder.bind(Migrate, to=migrate)
